from Model.models import *


class RoleInfo(models.Model):
    role_id = models.IntegerField(blank=True, null=True)
    name = models.CharField(max_length=50, blank=True, null=True)
    page_auth = models.CharField(max_length=255, blank=True, null=True)
    operation_auth = models.CharField(max_length=255, blank=True, null=True)
    page_auth_name = models.TextField(blank=True, null=True)
    page_auth_filter = models.TextField(blank=True, null=True)
    operation_auth_name = models.TextField(blank=True, null=True)

    class Meta:
        db_table = 'role_info'


class UserInfo(models.Model):
    user_id = models.IntegerField(blank=True, null=True)
    user_name = models.CharField(max_length=50, blank=True, null=True)
    real_name = models.CharField(max_length=50, blank=True, null=True)
    telephone = models.CharField(max_length=255, blank=True, null=True)
    email = models.CharField(max_length=255, blank=True, null=True)
    role = models.TextField(blank=True, null=True)
    role_name = models.TextField(blank=True, null=True)
    avatar = models.TextField(blank=True, null=True)

    class Meta:
        db_table = 'user_info'


class SubDistrictInfo(models.Model):
    subdistrict_id = models.IntegerField(blank=True, null=True)
    name = models.CharField(max_length=50, blank=True, null=True)
    district_id = models.IntegerField(blank=True, null=True)
    district_name = models.CharField(max_length=50, blank=True, null=True)
    city = models.CharField(max_length=50, blank=True, null=True)

    class Meta:
        db_table = 'subdistrict_info'


class CommunityInfo(models.Model):
    community_id = models.IntegerField(blank=True, null=True)
    name = models.CharField(max_length=50, blank=True, null=True)
    district_id = models.IntegerField(blank=True, null=True)
    district_name = models.CharField(max_length=50, blank=True, null=True)
    subdistrict_id = models.IntegerField(blank=True, null=True)
    subdistrict_name = models.CharField(max_length=50, blank=True, null=True)
    city = models.CharField(max_length=50, blank=True, null=True)

    class Meta:
        db_table = 'community_info'


class AddressInfo(models.Model):
    address_id = models.IntegerField(blank=True, null=True)
    name = models.CharField(max_length=50, blank=True, null=True)
    district_id = models.IntegerField(blank=True, null=True)
    district_name = models.CharField(max_length=50, blank=True, null=True)
    subdistrict_id = models.IntegerField(blank=True, null=True)
    subdistrict_name = models.CharField(max_length=50, blank=True, null=True)
    community_id = models.IntegerField(blank=True, null=True)
    community_name = models.CharField(max_length=50, blank=True, null=True)
    city = models.CharField(max_length=50, blank=True, null=True)

    class Meta:
        db_table = 'address_info'


class ContractInfo(models.Model):
    contract_id = models.IntegerField(blank=True, null=True)
    client_id = models.IntegerField(blank=True, null=True)
    linkman = models.CharField(max_length=30, blank=True, null=True)
    link_telephone = models.CharField(max_length=20, blank=True, null=True)
    service_package = models.IntegerField()
    start_date = models.DateTimeField(blank=True, null=True)
    end_date = models.DateTimeField(blank=True, null=True)
    district = models.IntegerField(blank=True, null=True)
    subdistrict = models.IntegerField(blank=True, null=True)
    community = models.IntegerField(blank=True, null=True)
    address = models.IntegerField(blank=True, null=True)
    detail_address = models.CharField(max_length=50, blank=True, null=True)
    install_address = models.CharField(max_length=255, blank=True, null=True)
    agreement = models.CharField(max_length=50, blank=True, null=True)
    memo = models.TextField(blank=True, null=True)
    agreement_img = models.CharField(max_length=20, blank=True, null=True)
    create_date = models.DateTimeField(blank=True, null=True)
    account_number = models.CharField(max_length=30, blank=True, null=True)
    account_password = models.CharField(max_length=30, blank=True, null=True)
    operator = models.CharField(max_length=20, blank=True, null=True)
    package_name = models.CharField(max_length=30, blank=True, null=True)
    renew_state = models.IntegerField(blank=True, null=True)
    installer = models.CharField(max_length=255, blank=True, null=True)
    state = models.IntegerField(blank=True, null=True)

    class Meta:
        db_table = 'contract_info'
